package com.zqxq.lottery.api.controller;

import com.baomidou.mybatisplus.plugins.Page;
import com.zqxq.common.constant.Result;
import com.zqxq.common.enums.CodeEnum;
import com.zqxq.lottery.api.feign.LotteryServerFeignClient;
import com.zqxq.lottery.entity.bo.sys.SysNewsCMSBO;
import com.zqxq.lottery.entity.vo.sys.SysNewsVO;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description ：
 * @Author ： 苦智
 * @Date ： 2018/03/22 11:06
 */
@Api(value = "代理商接口",tags = "代理商接口")
@RestController
@Slf4j
@RequestMapping(value = "/agent", produces = "application/json")
public class UserAgentController {

    @Autowired
    private LotteryServerFeignClient lotteryServerFeignClient;

    @ApiOperation("分页获取代理用户数据")
    @RequestMapping("/queryAgentData")
    public Result queryNewsPageList(@ApiParam(value = "代理用户id",required = true) String agentId,
                                                     @ApiParam(value = "日期类型 1：月 2：天",required = true) @RequestParam(defaultValue = "1") Integer timeType,
                                                     @ApiParam(value = "月份",required = false) String month,
                                                     @ApiParam(value = "页码",required = true) @RequestParam(defaultValue = "1") Integer pageNo,
                                                     @ApiParam(value = "每页条数",required = true) @RequestParam(defaultValue = "10") Integer pageSize){
        log.info("分页获取代理用户数据agentId={},timeType={},month={}",agentId,timeType,month);
        return lotteryServerFeignClient.queryAgentDataById(agentId,timeType,month,pageNo,pageSize);
    }
}
